:root {
    --primary: #4a6bff;
    --primary-light: #eef0ff;
    --secondary: #00c4cc;
    --success: #00c853;
    --warning: #ff9100;
    --danger: #ff5252;
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius-sm: 0.125rem;
    --radius: 0.25rem;
    --radius-md: 0.375rem;
    --radius-lg: 0.5rem;
}

/* 暗主题样式 */
[data-theme="dark"] {
    --primary: #6b8cff;
    --primary-light: #2a3b65;
    --white: #121212;
    --gray-50: #1e1e1e;
    --gray-100: #2d2d2d;
    --gray-200: #3a3a3a;
    --gray-300: #4d4d4d;
    --gray-400: #6b6b6b;
    --gray-500: #888888;
    --gray-600: #a0a0a0;
    --gray-700: #c0c0c0;
    --gray-800: #e0e0e0;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Noto Sans SC', sans-serif;
    background-color: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.5;
    transition: background-color 0.3s, color 0.3s;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* 顶部导航栏 */
.header {
    background-color: var(--white);
    box-shadow: var(--shadow);
    padding: 1rem 0;
    margin-bottom: 1.5rem;
    transition: background-color 0.3s;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-icon {
    color: var(--primary);
    font-size: 1.5rem;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
}

.header-actions {
    display: flex;
    gap: 1rem;
}

.theme-toggle {
    background: none;
    border: none;
    color: var(--gray-600);
    cursor: pointer;
    font-size: 1.25rem;
    transition: color 0.3s;
}

[data-theme="dark"] .theme-toggle {
    color: var(--gray-300);
}

/* 搜索框 */
.search-container {
    margin: 1.5rem 0;
    max-width: 100%;
}

.search-box {
    position: relative;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 0.9rem;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
    background-color: var(--white);
    color: var(--gray-800);
}

[data-theme="dark"] .search-input {
    border-color: var(--gray-300);
    background-color: var(--gray-100);
    color: var(--gray-700);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(74, 107, 255, 0.1);
}

[data-theme="dark"] .search-input:focus {
    box-shadow: 0 0 0 3px rgba(107, 140, 255, 0.3);
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
}

[data-theme="dark"] .search-icon {
    color: var(--gray-500);
}

/* 迷你搜索框 */
.mini-search-container {
    margin: 1rem 0;
    max-width: 400px;
}

.mini-search-box {
    position: relative;
}

.mini-search-input {
    width: 100%;
    padding: 0.5rem 1rem 0.5rem 2rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
    background-color: var(--white);
    color: var(--gray-800);
}

[data-theme="dark"] .mini-search-input {
    border-color: var(--gray-300);
    background-color: var(--gray-100);
    color: var(--gray-700);
}

.mini-search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(74, 107, 255, 0.1);
}

[data-theme="dark"] .mini-search-input:focus {
    box-shadow: 0 0 0 3px rgba(107, 140, 255, 0.3);
}

.mini-search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    font-size: 0.85rem;
}

[data-theme="dark"] .mini-search-icon {
    color: var(--gray-500);
}

/* 主要内容区 */
main {
    padding: 0 0 2rem;
}

/* 服务概览卡片 */
.overview {
    margin-bottom: 2rem;
    text-align: center;
}

.overview-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.overview-desc {
    color: var(--gray-600);
    max-width: 800px;
    margin: 0 auto 1.5rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-content: center;
    transition: background-color 0.3s, box-shadow 0.3s;
}

[data-theme="dark"] .stat-card {
    background: var(--gray-100);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
}

.stat-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.stat-icon.primary {
    background-color: var(--primary-light);
    color: var(--primary);
}

.stat-icon.secondary {
    background-color: rgba(0, 196, 204, 0.1);
    color: var(--secondary);
}

.stat-icon.success {
    background-color: rgba(0, 200, 83, 0.1);
    color: var(--success);
}

.stat-info {
    text-align: left;
}

.stat-label {
    font-size: 1rem;
    color: var(--gray-500);
}

[data-theme="dark"] .stat-label {
    color: var(--gray-400);
}

.stat-value {
}

/* 分类部分 */
.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 2rem 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.category-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1rem;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

[data-theme="dark"] .category-card {
    background: var(--gray-100);
    box-shadow: var(--shadow);
}

.category-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

[data-theme="dark"] .category-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
}

.category-card.active {
    border-color: var(--primary);
    background-color: var(--primary-light);
}

[data-theme="dark"] .category-card.active {
    background-color: var(--primary);
}

.category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.category-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.category-count {
    background: var(--gray-100);
    color: var(--gray-600);
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
}

[data-theme="dark"] .category-count {
    background: var(--gray-200);
    color: var(--gray-400);
}

/* API列表部分 */
.api-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.api-item {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

[data-theme="dark"] .api-item {
    background: var(--gray-100);
    box-shadow: var(--shadow-sm);
}

.api-item:hover {
    box-shadow: var(--shadow);
}

[data-theme="dark"] .api-item:hover {
    box-shadow: var(--shadow);
}

.api-header {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
    gap: 0.5rem;
}

.api-method {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    white-space: nowrap;
}

.api-method.get {
    background-color: rgba(74, 107, 255, 0.1);
    color: var(--primary);
}

[data-theme="dark"] .api-method.get {
    background-color: rgba(107, 140, 255, 0.2);
}

.api-method.post {
    background-color: rgba(0, 200, 83, 0.1);
    color: var(--success);
}

[data-theme="dark"] .api-method.post {
    background-color: rgba(0, 200, 83, 0.2);
}

.api-method.put {
    background-color: rgba(255, 145, 0, 0.1);
    color: var(--warning);
}

[data-theme="dark"] .api-method.put {
    background-color: rgba(255, 145, 0, 0.2);
}

.api-method.delete {
    background-color: rgba(255, 82, 82, 0.1);
    color: var(--danger);
}

[data-theme="dark"] .api-method.delete {
    background-color: rgba(255, 82, 82, 0.2);
}

.api-path {
    font-size: 0.875rem;
    color: var(--gray-700);
    flex-grow: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

[data-theme="dark"] .api-path {
    color: var(--gray-600);
}

.api-desc {
    font-size: 0.85rem;
    color: var(--gray-600);
    margin-bottom: 0.75rem;
    flex-grow: 1;
}

[data-theme="dark"] .api-desc {
    color: var(--gray-500);
}

.api-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.5rem;
}

.copy-btn {
    background: none;
    border: none;
    color: var(--gray-500);
    font-size: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: color 0.2s;
}

[data-theme="dark"] .copy-btn {
    color: var(--gray-400);
}

.copy-btn:hover {
    color: var(--primary);
}

/* 模态框样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal {
    background: var(--white);
    border-radius: var(--radius);
    width: 90%;
    max-width: 800px;
    max-height: 100vh;
    overflow: auto;
    box-shadow: var(--shadow-lg);
    transform: translateY(20px);
    transition: transform 0.3s;
}

[data-theme="dark"] .modal {
    background: var(--gray-100);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

[data-theme="dark"] .modal-header {
    border-bottom: 1px solid var(--gray-300);
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--gray-500);
    cursor: pointer;
    transition: color 0.2s;
}

.close-btn:hover {
    color: var(--gray-700);
}

.modal-body {
    padding: 1.5rem;
}

.modal-section {
    margin-bottom: 1.5rem;
}

.modal-section-title {
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--gray-700);
}

.url-box {
    background: var(--gray-50);
    padding: 1rem;
    border-radius: var(--radius-sm);
    font-family: monospace;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    overflow-x: auto;
}

[data-theme="dark"] .url-box {
    background: var(--gray-200);
    color: var(--gray-700);
}

.params-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.params-table th, .params-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

[data-theme="dark"] .params-table th, [data-theme="dark"] .params-table td {
    border-bottom: 1px solid var(--gray-300);
}

.params-table th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--gray-700);
}

[data-theme="dark"] .params-table th {
    background: var(--gray-200);
    color: var(--gray-600);
}

.response-box {
    background: var(--gray-50);
    padding: 1rem;
    border-radius: var(--radius-sm);
    font-family: monospace;
    font-size: 0.75rem;
    max-height: 300px;
    overflow: auto;
}

[data-theme="dark"] .response-box {
    background: var(--gray-200);
    color: var(--gray-700);
}

/* 页脚样式 */
footer {
    background: var(--white);
    padding: 1.5rem 0;
    text-align: center;
    color: var(--gray-500);
    font-size: 0.875rem;
    border-top: 1px solid var(--gray-200);
    margin-top: 2rem;
}

/* 加载状态 */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: var(--gray-500);
}

.loading-spinner {
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 空状态 */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: var(--gray-500);
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    min-height: 200px;
}

[data-theme="dark"] .empty-state {
    background: var(--gray-100);
}

.empty-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--gray-400);
}

/* 响应式调整 */
@media (max-width: 992px) {
    .api-list {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .categories-grid {
        grid-template-columns: 1fr 1fr;
    }

    .api-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .categories-grid {
        grid-template-columns: 1fr;
    }
}